/**
- * Append the contents of the source path to the given file.
+ * Append the contents of the source path to the given file, OR queue
+ * the appending operation in anticipation of a later appendFinish() call.
* @param $srcPath String: location of the source file
* @param $toAppendPath String: path to append to.
* @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate
*/
abstract function append( $srcPath, $toAppendPath, $flags = 0 );
+ /**
+ * Finish the append operation.
+ * @param $toAppendPath String: path to append to.
+ * @return mixed Status or false
+ */
+ abstract function appendFinish( $toAppendPath );
+
/**
* Remove a temporary file or mark it for garbage collection
* @param $virtualUrl String: the virtual URL returned by storeTemp
return $status;
}
+ /**
+ * Finish appending to the Repo file
+ *
+ * @param $toAppendPath String: path to the Repo file that will be appended to.
+ * @return Status Status
+ */
+ protected function appendFinish( $toAppendPath ) {
+ $repo = RepoGroup::singleton()->getLocalRepo();
+ $status = $repo->appendFinish( $toAppendPath );
+ return $status;
+ }
+
+
/**
* @param $srcPath String: the source path
* @return the real path if it was a virtual URL